﻿namespace ManagedChangeJournal.Native.Journal
{
    using System;

    [Flags]
    public enum ChangeReason : uint
    {
        /// <summary>
        /// A user has either changed one or more file or directory attributes 
        /// (such as the read-only, hidden, system, archive, or sparse attribute), or one or more time stamps.
        /// </summary>
        BasicInfoChange = 0x00008000,
        /// <summary>
        /// The file or directory is closed.
        /// </summary>
        Close = 0x80000000,
        /// <summary>
        /// The compression state of the file or directory is changed from or to compressed.
        /// </summary>
        CompressionChange = 0x00020000,
        /// <summary>
        /// The file or directory is added to.
        /// </summary>
        DataExtend = 0x00000002,
        /// <summary>
        /// Data in the file or directory is overwritten.
        /// </summary>
        DataOverwrite = 0x00000001,
        /// <summary>
        /// The file or directory is truncated.
        /// </summary>
        DataTruncation = 0x00000004,
        /// <summary>
        /// The user makes a change to the file or directory extended attributes. 
        /// These NTFS file system attributes are not accessible to Windows-based applications.
        /// </summary>
        ExtendedAttributesChange = 0x00000400,
        /// <summary>
        /// The file or directory is encrypted or decrypted.
        /// </summary>
        EncryptionChange = 0x00040000,
        /// <summary>
        /// The file or directory is created for the first time.
        /// </summary>
        FileCreate = 0x00000100,
        /// <summary>
        /// The file or directory is deleted.
        /// </summary>
        FileDelete = 0x00000200,
        /// <summary>
        /// An NTFS file system hard link is added to or removed from the file or directory. 
        /// An NTFS file system hard link, similar to a POSIX hard link, is one of several directory 
        /// entries that see the same file or directory.
        /// </summary>
        HardLinkChange = 0x00010000,
        /// <summary>
        /// A user changed the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute. 
        /// That is, the user changed the file or directory from one that can be content indexed
        /// to one that cannot, or vice versa. (Content indexing permits rapid searching of data
        /// by building a database of selected content.)
        /// </summary>
        IndexableChange = 0x00004000,
        /// <summary>
        /// One or more named data streams for the file were added to.
        /// </summary>
        NamedDataExtend = 0x00000020,
        /// <summary>
        /// Data in one or more named data streams for the file is overwritten.
        /// </summary>
        NamedDataOverwrite = 0x00000010,
        /// <summary>
        /// One or more named data streams for the file is truncated.
        /// </summary>
        NamedDataTruncation = 0x00000040,
        /// <summary>
        /// The object identifier of the file or directory is changed.
        /// </summary>
        ObjectIDChange = 0x00080000,
        /// <summary>
        /// The file or directory is renamed, and the file name in the USN_RECORD structure holding this journal record is the new name.
        /// </summary>
        RenameNewName = 0x00002000,
        /// <summary>
        /// The file or directory is renamed, and the file name in the USN_RECORD structure holding this journal record is the previous name.
        /// </summary>
        RenameOldName = 0x00001000,
        /// <summary>
        /// The reparse point contained in the file or directory is changed, or a reparse point is added to or deleted from the file or directory.
        /// </summary>
        ReparsePointChange = 0x00100000,
        /// <summary>
        /// A change is made in the access permissions to the file or directory.
        /// </summary>
        SecurityChange = 0x00000800,
        /// <summary>
        /// A named stream is added to or removed from the file or directory, or a named stream is renamed.
        /// </summary>
        StreamChange = 0x00200000,
        /// <summary>
        /// 
        /// </summary>
        All = BasicInfoChange | Close | CompressionChange | DataExtend | DataOverwrite | DataTruncation |
            ExtendedAttributesChange | EncryptionChange | FileCreate | FileDelete | HardLinkChange | IndexableChange |
            NamedDataExtend | NamedDataOverwrite | NamedDataTruncation | ObjectIDChange | RenameNewName | RenameOldName |
            ReparsePointChange | StreamChange | SecurityChange,
    }
}
